/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: LIUYANJIAO
 * Date: 2025-03-14
 * Time: 21:56
 */
public class test1 {
    public static String solve (String s, String t) {
        // write code here
       //两个字符串相加，如果有进位，则在结果字符串的最右侧加上1
        StringBuilder sb =new StringBuilder();
        int count=0;
        int len1=s.length()-1;
        int len2=t.length()-1;
        int sum=0;
        while(len1>=0||len2>=0){
            if(len1>=0){
                sum+=s.charAt(len1)-'0';
                len1--;
            }
            if(len2>=0){
                sum+=t.charAt(len2)-'0';
                len2--;
            }
            //头插
            sb.insert(0,sum%10);
            count=sum/10;
            sum=count;
        }
        if(count==1){
            sb.insert(0,sum%10);
        }

        System.out.println(sb.toString());
        return sb.toString();
    }

    public static void main(String[] args) {
        String solve = solve("1", "99");

    }
}
